Add an introspection api test
authorMatthias Clasen <mclasen@redhat.com>
Wed, 5 May 2021 00:39:52 +0000 (20:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 5 May 2021 23:18:32 +0000 (19:18 -0400)
Every beginning is small... just check one constant for now.

meson.build
testsuite/introspection/api.py [new file with mode: 0755]
testsuite/introspection/meson.build [new file with mode: 0644]
testsuite/meson.build

index 93231f90250ad8db64344a2bb484b3928b1286d0..b0314179a84dcea29d569e90bf03e3b99013ed7f 100644 (file)
@@ -733,6 +733,8 @@ int main () {
   endif
 endif
 
+project_build_root = meson.current_build_dir()
+
 subdir('gtk/css')
 subdir('gdk')
 subdir('gsk')
diff --git a/testsuite/introspection/api.py b/testsuite/introspection/api.py
new file mode 100755 (executable)
index 0000000..c35b2b7
--- /dev/null
@@ -0,0 +1,10 @@
+#! /usr/bin/env python3
+
+import sys
+import gi
+
+gi.require_version('Gtk', '4.0')
+
+from gi.repository import Gtk
+
+assert isinstance(Gtk.INVALID_LIST_POSITION, int), 'Gtk.INVALID_LIST_POSITION is not an int'
diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build
new file mode 100644 (file)
index 0000000..58eea5a
--- /dev/null
@@ -0,0 +1,8 @@
+
+test('api',
+     find_program('api.py', dirs: meson.current_source_dir()),
+     suite: ['introspection'],
+     env: [
+       'GI_TYPELIB_PATH=@0@/gtk:/usr/lib64/girepository-1.0'.format(project_build_root),
+       'LD_PRELOAD=@0@/gtk/libgtk-4.so'.format(project_build_root),
+     ])
index fafe6ea140f23d607d4b2e798888777b191b5e56..0b75c90811fbc4809a01a2c0eb1695e381b8f928 100644 (file)
@@ -56,3 +56,7 @@ subdir('css')
 subdir('a11y')
 subdir('tools')
 subdir('reftests')
+
+if build_gir
+  subdir('introspection')
+endif